package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.UserBackMapper;
import com.ruoyi.user.domain.UserBack;
import com.ruoyi.user.service.IUserBackService;

/**
 * 银行卡Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class UserBackServiceImpl implements IUserBackService 
{
    @Autowired
    private UserBackMapper userBackMapper;

    /**
     * 查询银行卡
     * 
     * @param id 银行卡主键
     * @return 银行卡
     */
    @Override
    public UserBack selectUserBackById(Long id)
    {
        return userBackMapper.selectUserBackById(id);
    }

    /**
     * 查询银行卡列表
     * 
     * @param userBack 银行卡
     * @return 银行卡
     */
    @Override
    public List<UserBack> selectUserBackList(UserBack userBack)
    {
        return userBackMapper.selectUserBackList(userBack);
    }

    /**
     * 新增银行卡
     * 
     * @param userBack 银行卡
     * @return 结果
     */
    @Override
    public int insertUserBack(UserBack userBack)
    {
        userBack.setCreateTime(DateUtils.getNowDate());
        return userBackMapper.insertUserBack(userBack);
    }

    /**
     * 修改银行卡
     * 
     * @param userBack 银行卡
     * @return 结果
     */
    @Override
    public int updateUserBack(UserBack userBack)
    {
        userBack.setUpdateTime(DateUtils.getNowDate());
        return userBackMapper.updateUserBack(userBack);
    }

    /**
     * 批量删除银行卡
     * 
     * @param ids 需要删除的银行卡主键
     * @return 结果
     */
    @Override
    public int deleteUserBackByIds(Long[] ids)
    {
        return userBackMapper.deleteUserBackByIds(ids);
    }

    /**
     * 删除银行卡信息
     * 
     * @param id 银行卡主键
     * @return 结果
     */
    @Override
    public int deleteUserBackById(Long id)
    {
        return userBackMapper.deleteUserBackById(id);
    }
}
